package com.satan.vote.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.satan.vote.entity.VoteItem;
import com.satan.vote.entity.WxUserInfo;
import com.satan.vote.serializer.CustomDateTimeDerializer;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @ClassName VoteDTO
 * @Description TODO
 * @date 2023/8/13 16:26
 * @Version 1.0
 */
@Data
public class VoteDTO {
    private Integer id; // 编号
    private String title; // 标题
    private String explanation; // 投票说明
    private String coverImage; // 封面图片
    @JsonDeserialize(using= CustomDateTimeDerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime voteEndTime; // 投票结束时间
    private String openid; // 投票发起人openid
    private List<VoteItem> voteItemList;
    private WxUserInfo wxUserInfo;
    private Integer type; // 1 文字投票 2 图片投票

}
